/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 28779
 * Date: 2023-03-26
 * Time: 10:02
 */

class Animal{
    protected String name;

    public Animal(String name) {
        this.name = name;
    }
    public void eat(){
        System.out.println(this.name + "正在汪汪！！！");
    }
}

class Dog extends Animal{
    public Dog(String name){
        super(name);
    }
    @Override
    public void eat(){
        System.out.println(this.name + "正在汪汪！！！");
    }
}

class Cat extends Animal{
    public Cat(String name){
        super(name);
    }
    @Override
    public void eat(){
        System.out.println(this.name + " 正在喵喵！！！");
    }
}

public class Test {
    public static void testFunc(){
        Animal animalw = new Dog("建委");
        animalw.eat();
/*        Animal[] animals = {new Cat("jianwei"),new Dog("zhaohan")};
        for (Animal animal :animals) {
            animal.eat();

        }*/
    }

    public static void testFunc1(Animal animal){
        animal.eat();
    }
    public static void main(String[] args) {
       Dog dog = new Dog("李建委");
        testFunc();
        testFunc1(dog);
        //dog.eat();
        //Cat cat = new Cat("mimi");
        //cat.eat();
        //testFunc(cat);
    }

}
